#include <stdio.h>
#include <string.h>
#define BUFFER_SIZE 100

int main()
{
    int count = 1;
    char buffer[BUFFER_SIZE];
    printf("请输入一个字符串buffer：");
    scanf("%[^\n]s", buffer);//scanf接受空格操作哦
    printf("buffer:%s\n",buffer);
    int len = strlen(buffer);
    printf("len:%d\n", len);
    int flag = 0;
    while(1)
    {
        for(int idx = 0; idx < len ; idx++)
        {
            if((buffer[idx] == ' ' || buffer[idx] == '\0') && flag)
            {
                count++;
                flag = 0;
            }
            else
            {
                flag = 1;
            }            
        }
        break;
    }
    printf("buffer:%d\n",count);
    return 0;
}






